package com.qianyu.project.core.api;

import com.qianyu.project.core.bean.FormAudit;
import com.qianyu.project.core.service.IFormAuditService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @author gs
 * @date create in 2020/12/11 19:02
 */
@Api(tags = "审批详情管理接口")
@RestController
@RequestMapping("/formAudits")
public class FormAuditController {

    @Autowired
    private IFormAuditService formAuditService;

    @PostMapping
    public Result save(@RequestBody FormAudit formAudit) {
        formAuditService.save(formAudit);
        return ResultTool.success();
    }

    @GetMapping("/form/{fid}")
    public Result findByForm(@PathVariable Integer fid) {
        return ResultTool.success(formAuditService.getByForm(fid));
    }

}
